home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1995 May / PC Direct CD-ROM (May 1995).ISO / ipe / misc / ipe_win.dcl < prev    next >
Encoding:
Text File  |  1994-11-17  |  19.6 KB  |  454 lines

  1. REM ::ExeType=Windows
  2. REM ::ExePath=L:\IPE_WIN.EXE
  3.  
  4. ' *****************************************************************************************************************************
  5. '                                                                DCL Install program for IPE/McAfee CD-ROM
  6. '
  7. ' ******************************************************************************************************************************
  8. '                                      Copyright 1994 - IPE Corporation
  9. ' ******************************************************************************************************************************
  10.  
  11. Sub main()    
  12.  
  13.     On Error goto errortrap
  14.  
  15.     dim Products$(13) as string                ' Define product array
  16.     dim Program$(12) as string                ' Define product install programs
  17.     dim Location$(12) as String                ' Define where they all are
  18.     dim WinApp$ () as string                 ' Define list for active windows 
  19.  
  20. ' ******************************************************************************************************************************
  21. '       Miscellaneous variables and initialisations
  22. ' ******************************************************************************************************************************
  23.                   
  24.     Disk$=""                                ' Drive letter for CD
  25.     Edit$="notepad.exe"                    ' Usual display editor  - if file too large, switches to Write
  26.     Trigger$=":\ipe_win.exe"                ' Check to see if CD mounted
  27.     Document$="\oview.txt"                    ' Overview Document for each product
  28.     OutString$=""
  29.     Loop%=TRUE
  30.     Notepad$=""
  31.     Write$=""
  32.     WallPaper$=ReadIni$("Desktop","Wallpaper")    ' Record current Windows Wallpaper
  33.     Tile$=ReadIni$("Desktop","TileWallpaper")        ' and tile option
  34.  
  35. ' ******************************************************************************************************************************
  36. '       Setup product arrays and pathnames
  37. ' ******************************************************************************************************************************
  38.  
  39.     Products$(0)="BrightWorks"                    ' Product NAME array
  40.     Products$(1)="NetTools"
  41.     Products$(2)="VirusScan"
  42.     Products$(3)="NetShield"
  43.     Products$(4)="LAN Support Centre"
  44.     Products$(5)="HELP Plus"
  45.     Products$(6)="SiteMeter"
  46.     Products$(7)="LAN Inventory"
  47.     Products$(8)="NetRemote"
  48.     Products$(9)="ProtecNet"
  49.     Products$(10)="Other Products"
  50.     Products$(11)="Other Information"
  51.     Products$(12)="Presentation"
  52.  
  53.     Program$(0)="bri120e\disk1\setup.exe"            ' Product INSTALL program array 
  54.     Program$(1)="nt51e\disk1\setupm.exe"
  55.     Program$(2)="scan\install.bat"
  56.     Program$(3)="netshld"
  57.     Program$(4)="lsc301e\disk1\setup.exe"
  58.     Program$(5)="hplus20e\disk1\setup.exe"
  59.     Program$(6)="smr43e\disk1\setup.exe"
  60.     Program$(7)="lai313e\disk1\setup.exe"
  61.     Program$(8)="nr521e\disk1\setup.exe"
  62.     Program$(9)="protec\netinst.exe"
  63.     Program$(10)="n/a"
  64.     Program$(11)="n/a"
  65.  
  66.     Location$(0)="bri120e\disk1"                    ' Product LOCATION array
  67.     Location$(1)="nt51e\disk1"
  68.     Location$(2)="scan"
  69.     Location$(3)="netshld"
  70.     Location$(4)="lsc301e\disk1"
  71.     Location$(5)="hplus20e\disk1"
  72.     Location$(6)="smr43e\disk1"
  73.     Location$(7)="lai313e\disk1"
  74.     Location$(8)="nr521e\disk1"
  75.     Location$(9)="protec"
  76.     Location$(10)="other"
  77.     Location$(11)="misc"
  78.  
  79. ' *****************************************************************************************************************************
  80. '                                Setup main dialog box
  81. ' *****************************************************************************************************************************
  82.     Begin Dialog UserDialog 84,24,305,281, "IPE - McAfee FULL Function Evaluation Product"
  83.         OptionGroup .OptionGroup1
  84.             OptionButton 30,50,72,14, "BrightWorks"
  85.             OptionButton 30,65,48,14, "NetTools"
  86.             OptionButton 30,80,48,14, "VirusScan"
  87.             OptionButton 30,95,48,14, "NetShield"
  88.             OptionButton 30,110,84,14, "LAN Support Centre"
  89.             OptionButton 30,125,48,14, "HELP Plus"
  90.             OptionButton 30,140,48,14, "SiteMeter"
  91.             OptionButton 30,155,80,14, "LAN Inventory"
  92.             OptionButton 30,170,48,14, "NetRemote"
  93.             OptionButton 30,185,80,14, "ProtecNet"
  94.             OptionButton 30,200,80,14, "Other Products"
  95.             OptionButton 30,215,80,14, "Other Information"
  96.             OptionButton 30,230,90,14, "Presentation"
  97.         PushButton 177,120,73,16, "Product Install"
  98.         PushButton 177,75,73,16, "View Information"
  99.         PushButton 240,252,41,14, "Exit"
  100.         Text 173,56,73,8, "3.   Select the Option"
  101.         Text 15,38,79,8, "2.   Select the Product"
  102.         Text 4,256,231,8, "For licensed product - CONTACT YOUR LOCAL DEALER or Ring IPE"
  103.         Text 180,150,80,8, "IPE Corporation Ltd"
  104.         Text 180,160,58,8, "9, Alfred Place,"
  105.         Text 180,170,43,8, "LONDON"
  106.         Text 180,180,43,8, "WC1E 7EB"
  107.         Text 180,200,79,8, "Tel: 0171 436 2244"
  108.         Text 180,210,79,8, "Fax: 0171 916 1004"
  109.         Text 180,220,79,8, "BBS: 0171 916 1025"
  110.         Text 15,10,140,8, "1.  Click here for an Introduction 'Readme' "
  111.         PushButton 175,9,73,16, "Readme First"
  112.         PushButton 177,97,73,16, "Documentation"
  113.     End Dialog
  114.  
  115. ' ****************************************************************************************************************************
  116. '                            Setup Install request after readme
  117. ' ****************************************************************************************************************************
  118.     Begin Dialog UserDialog2 258,136,126,105, "IPE - McAfee Install"
  119.         Text 3,17,116,8, "Do you wish to install the product?"
  120.         PushButton 40,47,41,14, "No"
  121.         PushButton 40,73,41,14, "Yes"
  122.     End Dialog
  123.  
  124. ' ****************************************************************************************************************************
  125. ' Set up arrays for dialog response
  126. ' ****************************************************************************************************************************
  127.  
  128.     Dim Choice as UserDialog
  129.     Dim Choice2 as UserDialog2
  130.     Dim DDrives$() as string
  131.  
  132. ' ****************************************************************************************************************************
  133. ' MAIN CODE BEGINS......... sort out the basics, CD drive letter, either Notepad or Write or both
  134. ' ****************************************************************************************************************************
  135.  
  136.     DiskDrives DDrives$                        ' Find out what disks are available
  137.     For i% = lbound(DDrives$) to ubound(DDrives$) 
  138.         if Notepad$="" then                        ' There HAS to be someone who doesn't have Notepad in Windows!
  139.             if FileExists (DDrives$(i%)+":\windows\notepad.exe") then
  140.                 Notepad$=DDrives$(i%)+":\windows\notepad.exe"
  141.                     end if
  142.         end if
  143.         if Write$="" then                        ' There HAS to be someone who doesn't have Write in Windows
  144.             if FileExists (DDrives$(i%)+":\windows\write.exe") then
  145.                 Write$=DDrives$(i%)+":\windows\write.exe"
  146.                     end if
  147.         end if
  148.         if FileExists(DDrives$(i%)+Trigger$) then    ' This is the CD drive letter - ie where ipe_win.exe  lives
  149.             Disk$=LCase$(DDrives$(i%)+":\")        ' make sure the :\ is present
  150.         end if
  151.         next i%    
  152.     if Notepad$="" AND Write$="" then
  153.         MsgBox "Please install Windows Notepad and Write before continuing!",16,"Catch 22!"
  154.         goto Out                                ' Cannot go on without SOME way to display text!!!!!!!!!!
  155.     end if
  156.     if Notepad$="" then
  157.         Notepad$=Write$                        ' Needs one .........
  158.     end if
  159.     if Write$="" then
  160.         Write$=Notepad$                        ' ............. or the other!
  161.     end if
  162.     If Disk$="" then                            ' No drive letter for CD-ROM found - try again
  163.         MsgOpen "Put the IPE CD-ROM in the drive and re-start",0,FALSE,FALSE
  164.         Sleep 3000
  165.         MsgClose                            ' Exit if CD not found
  166.         goto Out
  167.     end if
  168.  
  169. ' ****************************************************************************************************************************
  170. '       Minimise current Windows applications, save current wallpaper and put up IPE logo
  171. ' ****************************************************************************************************************************
  172.  
  173.     AppName$=AppGetActive$()                    ' Get active Application
  174.     AppList WinApp$
  175.     For i%=lbound(WinApp$) to ubound(WinApp$)
  176.         AppMinimize WinApp$(i%)
  177.     next i%                                    ' Minimize all current windows
  178.     DesktopSetWallpaper Disk$+"ipe-c.bmp", true            ' Replace wallpaper with IPE logo
  179.  
  180.     OutString$="This Install program was written in Desktop Control Language (DCL)          "
  181.     MsgOpen OutString$,10,FALSE,FALSE
  182.     Sleep 3000
  183.     OutString$="DCL is an Application Programming Language included with NetTools" 
  184.     MsgSetText OutString$
  185.     Sleep 5000
  186.     MsgClose                                ' Advertise DCL......
  187.  
  188. ' ****************************************************************************************************************************
  189. '       MAIN PROGRAM LOGIC BEGINS........
  190. ' ****************************************************************************************************************************
  191.  
  192.     While Loop%
  193.     a%=Dialog(Choice)                            ' Put up Main dialog screen
  194.     
  195.     Install:                                    ' Return point for install after read
  196.     select case a%
  197.  
  198. ' ****************************************************************************************************************************
  199. '         INSTALL option
  200. ' ****************************************************************************************************************************
  201.         case 1
  202.  
  203.             if Choice.OptionGroup1=3 then        ' but not for NetShield - special case
  204.                 Serv$=AskBox$("On which Server is NetShield to be Installed? ")
  205.                 if Serv$="" then                ' Need to determine which server for NS NLMs
  206.                     goto Wendy
  207.                 end if
  208.             GetNet:
  209.                 Net$=AskBox$("Which Revision of NetWare is "+Serv$+" - 3.x or 4.x? ")
  210.                 if Net$="" then
  211.                     goto GetNet
  212.                 end if
  213.                 Net$=Mid$(Net$,1,1)
  214.                 Name$=NetUserName$(Serv$)                        ' logged in as ??
  215.                 MsgBox "You are logged in as "+Name$+" on server "+Serv$
  216.                 if Name$ <> "SUPERVISOR" then                        ' Should be SUPERVISOR for access
  217.                     MsgBox "You must be logged in as 'SUPERVISOR' on "+Serv$+" to install NetShield",0,"NSInstall"
  218.                     goto wendy
  219.                 end if
  220.  
  221.                 For i% = lbound(DDrives$) to ubound(DDrives$)    ' generate list of drive letters
  222.                     AllDrives$=AllDrives$+DDrives$(i%)        ' for Attach to get to SYS: volume
  223.                     next i%
  224.                 FreeDrive$=AskBox$("Chose a drive NOT in this current list",AllDrives$)
  225.                 if FreeDrive$="" then                        ' select a non-used letter
  226.                     goto Wendy
  227.                 end if
  228.                 FreeDrive$=Mid$(FreeDrive$,1,1)+":"            ' make sure the : is there
  229.                 if NetConnectDrive (FreeDrive$,Serv$+"\sys:\system") then
  230.                     MsgOpen "Copying "+Disk$+Program$(3)+"\*.* to "+FreeDrive$+"\system........                           ",0,FALSE,FALSE
  231.                     Part1=FileCopy(Disk$+Program$(3)+"\*.*",FreeDrive$+"\system")                ' general files
  232.                     Part2=FileCopy(Disk$+Program$(3)+"\netware."+Net$+"\*.*",FreeDrive$+"\system")    ' NetWare version specific files
  233.                     if  Part1 AND Part2 then
  234.                         MsgSetText "File Copy successful - Load NetShield (NETSHLD.NLM) at Console"
  235.                         Sleep 5000
  236.                         MsgClose
  237.                     else
  238.                         MsgSetText "File Copy Failed! Check access rights."
  239.                         Sleep 2000
  240.                         MsgClose
  241.                     end if
  242.                     if NOT NetDisConnectDrive(mid$(FreeDrive$,1,1)) then        ' disconnect drive
  243.                         MsgBox "Drive Disconnect Failed!"
  244.                     end if
  245.                 else
  246.                     MsgBox "Drive Connect failed - check which drives are available"
  247.                 end if
  248.                     goto Wendy
  249.             end if
  250.  
  251. ' ****************************************************************************************************************************
  252. '            Special action for OTHER and MISCELLANEOUS
  253. ' ****************************************************************************************************************************
  254.  
  255.             if Choice.OptionGroup1>=10 then
  256.                 Msgbox "Select '"+Products$(Choice.OptionGroup1)+"' and the 'View Information' box",0,Products$(Choice.OptionGroup1)
  257.                 goto Wendy
  258.             end if
  259.  
  260. ' ****************************************************************************************************************************
  261. '            Warning about NetTools Custom install
  262. ' ****************************************************************************************************************************
  263.  
  264.             if Choice.OptionGroup1= 1 then
  265.                 MsgOpen"                                                                                                                              ",0,FALSE,FALSE
  266.                 MsgSetText  "FULL install only - for CUSTOM install, see NetTools 'View Information' "
  267.                 Sleep 5000                                        ' set up big empty box first
  268.                 MsgClose                                        ' then put text in.......
  269.             end if
  270.  
  271. ' ****************************************************************************************************************************
  272. '                       Main INSTALL code
  273. ' ****************************************************************************************************************************
  274.  
  275.             OutString$="Execute Install of "+Products$(Choice.OptionGroup1)+"?"
  276.             if msgbox(OutString$,4,"IPE - McAfee Install") = 6 then                    ' standard install of product
  277.                 if FileExists(Disk$+Program$(Choice.OptionGroup1)) then    ' if file exists!
  278.                     if Choice.OptionGroup1=2 then
  279.                         taskid%=shell(Disk$+Program$(2)+" "+disk$,3)
  280.                     else
  281.                         if Choice.OptionGroup1=9 then                        ' Kludge for Protec to see .INF 
  282.                             ChDrive Disk$
  283.                             ChDir Disk$+"protec"
  284.                         end if
  285.                         taskid%=shell(Disk$+Program$(Choice.OptionGroup1),3)
  286.                     end if
  287.  
  288. ' ****************************************************************************************************************************
  289. '                Wait code for NetTools and HelpPlus
  290. ' ****************************************************************************************************************************
  291.  
  292.                     if Choice.OptionGroup1= 1 OR Choice.OptionGroup1 = 5 then
  293.                         WaitForTaskCompletion taskid%
  294.                     end if
  295.                 else
  296.                     MsgOpen "File does not exist or is missing!",0,FALSE,FALSE
  297.                     Sleep 2000
  298.                     MsgClose
  299.                     goto Wendy                                        ' Blunder... install file missing
  300.                 end if
  301.             end if
  302.  
  303. ' ****************************************************************************************************************************
  304. '               INFORMATION option
  305. ' ****************************************************************************************************************************
  306.  
  307.         case 2
  308.  
  309.             if Choice.OptionGroup1=12 then
  310.                 MsgOpen "Please wait, presentation loading..............",0,FALSE,FALSE
  311.                 ChDrive Disk$
  312.                 ChDir Disk$+"misc"
  313.                 taskid%=shell(Disk$+"misc\pptview  ")
  314.                 WaitForTaskCompletion taskid%
  315.                 MsgClose
  316.                 goto Wendy                
  317.             end if
  318.         NextFile:                                                        ' back for next file in list
  319.             if Choice.OptionGroup1=10 OR Choice.OptionGroup1=11 then        ' misc and other need file list
  320.                 ChDrive Disk$
  321.                 ChDir "\"+Location$(Choice.OptionGroup1)
  322.                 File$=OpenFileName$("Read Me Files","All Files:*.txt,*.doc")    ' File list to select
  323.             else
  324.                 File$=Disk$+Location$(Choice.OptionGroup1)+Document$
  325.             end if
  326.             if File$="" then
  327.                 goto Wendy
  328.             end if    
  329.             if FileExists (File$) then                
  330.                 if FileLen (File$) < 40960 then                            ' notepad or edit?
  331.                     taskid%=shell(Edit$+" "+File$,3)                        ' depends on file size
  332.                 else
  333.                     taskid%=shell("write "+FILE$,3)
  334.                 end if
  335.                 WaitForTaskCompletion taskid%                            ' stay with editor
  336.                 if Choice.OptionGroup1=10 OR Choice.OptionGroup1=11 then
  337.                     goto NextFile                                        ' look at another one?
  338.                 end if
  339.             else
  340.                 MsgOpen "File does not exist or is missing!",0,FALSE,FALSE
  341.                 Sleep 2000
  342.                 MsgClose
  343.                 goto Wendy                                            ' Blunder - file does not exist
  344.             end if
  345.  
  346. ' ****************************************************************************************************************************
  347. '            Install after reading about it?
  348. ' ****************************************************************************************************************************
  349.             
  350.             if Choice.OptionGroup1 < 10 then                ' only for installable products
  351.                 b%=Dialog(Choice2)
  352.                 select case b%
  353.                     case 2
  354.                         a%=1                        ' set up for case 1 option in main loop
  355.                         goto Install                    ' go for it
  356.                     case 1
  357.                         MsgOpen "Returning to main Menu",10,FALSE,FALSE
  358.                         sleep 500                    
  359.                         MsgClose                    ' otherwise go back to main menu
  360.                 end select
  361.             end if
  362.  
  363. ' ****************************************************************************************************************************
  364. '        EXIT option
  365. ' ****************************************************************************************************************************
  366.  
  367.         case 3
  368.  
  369.             OutString$="Copyright IPE 1994"
  370.             MsgOpen OutString$,10,FALSE,FALSE
  371.             Sleep 2000
  372.             OutString$="        Goodbye"
  373.             MsgSetText OutString$
  374.             Sleep 2000
  375.             MsgClose
  376.             Loop%=FALSE                                ' logic to exit outer WHILE loop
  377.  
  378. ' ****************************************************************************************************************************
  379. '        README.1ST option
  380. ' ****************************************************************************************************************************
  381.  
  382.         case 4
  383.  
  384.             taskid%=shell (Notepad$+"  "+Disk$+"misc\readme.1st",3)
  385.             WaitForTaskCompletion taskid%
  386.  
  387. ' ****************************************************************************************************************************
  388. '        DOCUMENTATION option
  389. ' ****************************************************************************************************************************
  390.  
  391.         case 5
  392.  
  393.             if Choice.OptionGroup1 < 10 then
  394.                 if MsgBox("Documentation is in "+Disk$+Location$(Choice.OptionGroup1)+"  - Do you wish to view now?",4,"Documentation") = 6 then
  395.                     MsgClose
  396.                     ChDrive Disk$
  397.                     ChDir "\"+Location$(Choice.OptionGroup1)
  398.             Again:
  399.                     File$=OpenFileName$("Read Me Files","All Files:*.txt,*.doc")    ' get file list to view
  400.                     if File$="" then
  401.                         goto Wendy
  402.                     end if
  403.                 else
  404.                     goto Wendy
  405.                 end if
  406.                 if FileExists (File$) then                
  407.                     if FileLen (File$) < 40960 then                            ' notepad or edit?
  408.                         taskid%=shell(Notepad$+" "+File$,3)
  409.                     else
  410.                         taskid%=shell(Write$+" "+FILE$,3)
  411.                     end if
  412.                 WaitForTaskCompletion taskid%                                ' wait for the editor
  413.                 goto Again                                                ' chose another file?
  414.                 end if
  415.             else
  416.                 a%=2                                                    ' or install product.....
  417.                 goto Install
  418.             end if
  419. ' ****************************************************************************************************************************
  420.                 
  421.     end select
  422.  
  423. ' ****************************************************************************************************************************
  424. '       End of MAIN logic loop
  425. ' ****************************************************************************************************************************
  426.  
  427. Wendy:
  428.     Wend
  429.  
  430. ' ****************************************************************************************************************************
  431. '    PROGRAM NORMAL END
  432. '    Put back original Windows bits and pieces
  433. ' ****************************************************************************************************************************
  434.  
  435. Out:
  436.     on error goto 0                                        ' Don't want any errors at this late stage
  437.     DesktopSetWallpaper WallPaper$,Val(Tile$)                ' Replace old wallpaper
  438.     AppRestore AppName$
  439.     AppActivate AppName$                                ' Put back last active App
  440.     end                                                ' Go Home!
  441.  
  442. ' ****************************************************************************************************************************
  443. '    No one wants to come here................................
  444. ' ****************************************************************************************************************************
  445.  
  446. Errortrap:                                                ' To catch the X factor!!!
  447.     MsgBox "Error: "+str$(err())+" - "+Error$(err())+"taskid%="+str$(taskid%),0,"Error"
  448.     DesktopSetWallpaper WallPaper$,Val(Tile$)
  449.     on error goto 0                                        ' turn off error traps before exit
  450.         end
  451.  
  452. ' ****************************************************************************************************************************
  453. end sub                                                ' HORRAY!!!!!!!!
  454.